%Run routine 
addpath('functions\')
ComprehensiveStudy_nChangingLinAndSqRt;
nVec = [1 5 10 50 200 1000 5000];

%Run through microstructure routines and export price impact estimates,
%summary statistics, and standard errors to workspace for later usage

FileNames = {'output\ComprehensiveStudy_6AAll','output\ComprehensiveStudy_6BAll','output\ComprehensiveStudy_6CAll','output\ComprehensiveStudy_6EAll','output\ComprehensiveStudy_6JAll','output\ComprehensiveStudy_6SAll'};

AlphaVaryingNComposite_Linear = cell(1,6);
AlphaVaryingNComposite_SqRt = cell(1,6);
alphas = zeros(2,6);
AdditionalValuesAll = cell(1,6);
GabaixKoijenStyleMultiplierExport = zeros(1,5);
counter = 0;
while(counter<5)
    counter = counter+1; 
    ncounter = 0;
    alphaVaryingNComposite_Linear = zeros(size(nVec,2),2);
    alphaVaryingNComposite_SqRt = zeros(size(nVec,2),2);
    while(ncounter<size(nVec,2))
        ncounter = ncounter + 1;
        str = strcat(FileNames{1,counter},num2str(nVec(1,ncounter)),'OLSOnly');
        load(str,'betaMechComposite');
        alphaVaryingNComposite_Linear(ncounter,:)=betaMechComposite;
        load(str,'betaMechComposite05');
        alphaVaryingNComposite_SqRt(ncounter,:)=betaMechComposite05;
    end
    AlphaVaryingNComposite_Linear{1,counter} = alphaVaryingNComposite_Linear;
    AlphaVaryingNComposite_SqRt{1,counter} = alphaVaryingNComposite_SqRt;
end



oldFolder = cd('..');
save('intermediate\MicrostructureEstimatesAndOutputChangingNUpTo5000');
cd(oldFolder)



